package srx.open.com.utils;

import android.content.Context;
import cn.bmob.v3.BmobUser;

import srx.open.com.bean.User;

public class UserUtils {

	public static final String TAG = "UserUtils";

	/**
	 * 获取当前登录用户.
	 */
	public static User getCurrentUser(Context context) {
		User user = BmobUser.getCurrentUser(context, User.class);
		if (user != null) {
			Log.i(TAG, "本地用户信息" + user.getObjectId() + "-" + user.getUsername()
					+ "-" + user.getSessionToken() + "-" + user.getCreatedAt()
					+ "-" + user.getUpdatedAt()
			// + "-" + user.getSignature() + "-" + user.getSex()
			);
			return user;
		} else {
			Log.i(TAG, "本地用户为null,请登录。");
		}
		return null;
	}
}
